//
//  ViewController.m
//  ObtainResource
//
//  Created by shinho on 2021/5/7.
//

#import "ViewController.h"

#import "GZSelectAlbumVC.h"
#import "GZSelectVideoVC.h"

@interface ViewController ()

@property (nonatomic, strong) UIButton *selectResBtn;
@property (nonatomic, strong) UIButton *takeResourceBtn;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.modalPresentationStyle = UIModalPresentationFullScreen;  // 修改默认值
    
    [self.view addSubview:self.selectResBtn];
    [self.view addSubview:self.takeResourceBtn];
}

- (void)selectResBtnClick{
    
   [self.navigationController pushViewController:[GZSelectAlbumVC new] animated:YES];
}

- (void)takeResBtnClick{
    [self.navigationController pushViewController:[GZSelectVideoVC new] animated:YES];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    [self.navigationController.navigationBar setHidden:YES];
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    
    [self.navigationController.navigationBar setHidden:YES];
}

- (UIButton *)selectResBtn{
    if (!_selectResBtn) {
        _selectResBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _selectResBtn.backgroundColor = [UIColor cyanColor];
        _selectResBtn.frame = CGRectMake(100, 100, 100, 100);
        [_selectResBtn addTarget:self action:@selector(selectResBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _selectResBtn;
}

- (UIButton *)takeResourceBtn{
    if (!_takeResourceBtn) {
        _takeResourceBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _takeResourceBtn.backgroundColor = [UIColor brownColor];
        _takeResourceBtn.frame = CGRectMake(100, 250, 100, 100);
        [_takeResourceBtn addTarget:self action:@selector(takeResBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _takeResourceBtn;
}

@end
